﻿using Dapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIG.DAL.Dapper.Model
{

    /// <summary>
    /// A class which represents the PostSet table.
    /// </summary>
    [Table("PostSet")]
    public partial class Post
    {
        [Key]
        public virtual int Id { get; set; }
        public virtual string Title { get; set; }
        public virtual string Summary { get; set; }
        public virtual string Body { get; set; }
        public virtual bool Recommend { get; set; }
        public virtual bool Active { get; set; }
        public virtual string Thumbnail { get; set; }
        public virtual int ViewCount { get; set; }
        public virtual int CategoryId { get; set; }
        public virtual string CreatedBy { get; set; }
        public virtual DateTime CreatedDate { get; set; }
        public virtual DateTime? UpdatedDate { get; set; }
        public virtual string UpdatedBy { get; set; }
        public virtual PostCategory PostCategory { get; set; }

        [Editable(false)]
        public string CategoryTitle
        {
            get { return PostCategory != null ? PostCategory.Title : string.Empty; }
        }
    }

}
